package com.itheima.set;

import com.itheima.domain.Student;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.TreeSet;

/**
 * TreeSet存储自定义类型
 */
public class Test03 {

    public static void main(String[] args) {
     // Student  implements Comparetor  自然排序
        TreeSet<Student> set= new TreeSet<>();
        set.add(new Student("鹿晗",30));
        set.add(new Student("吴亦凡",30));
        set.add(new Student("黄子韬",27));
        set.add(new Student("蔡徐坤",22));

        System.out.println(set);
    }
}
